home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / h / param.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-13  |  1.6 KB  |  67 lines

  1.  
  2. /*    @(#)param.h 1.1 86/09/27 SMI    */
  3.  
  4. /*
  5.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  6.  */
  7.  
  8. /*
  9.  * Machine dependent constants for Sun-3.
  10.  */
  11. #define    NBPG    8192        /* bytes/page */
  12. #define    PGOFSET    (NBPG-1)    /* byte offset into page */
  13. #define    PGSHIFT    13        /* LOG2(NBPG) */
  14.  
  15. #define    NBSG    131072        /* bytes/segment */
  16. #define    SGOFSET    (NBSG-1)    /* byte offset into segment */
  17. #define    SGSHIFT    17        /* LOG2(NBSG) */
  18.  
  19. #define    CLSIZE        1
  20. #define    CLSIZELOG2    0
  21.  
  22. #define    SSIZE        1    /* initial stack size/NBPG */
  23. #define    SINCR        1    /* increment of stack/NBPG */
  24.  
  25. /*
  26.  * Define UADDR as a 32 bit address so that the compiler will
  27.  * generate short absolute references to access the u-area.
  28.  */
  29. #define    UADDR        (0-4*NBPG) /* u-area virtual address - 4th page down */
  30. #define    UPAGES        1    /* pages of u-area, NOT including red zone */
  31.  
  32. #define    KERNSTACK    0x800    /* size of kernel stack in u-area */
  33.  
  34. /*
  35.  * KERNELBASE is the virtual address which
  36.  * the kernel mapping starts in all contexts.
  37.  */
  38. #define    KERNELBASE    0x0F000000
  39.  
  40. /*
  41.  * Some macros for units conversion
  42.  */
  43. /* Core clicks (8192 bytes) to segments and vice versa */
  44. #define    ctos(x)    (((x)+15)>>(SGSHIFT-PGSHIFT))
  45. #define    stoc(x)    ((x)<<(SGSHIFT-PGSHIFT))
  46.  
  47. /* Page number to segment number */
  48. #define    ptos(x)    ((x)>>(SGSHIFT-PGSHIFT))
  49.  
  50. /* Core clicks (8192 bytes) to disk blocks and vice versa */
  51. #define    ctod(x)    ((x)<<4)
  52. #define    dtoc(x)    (((x)+15)>>4)
  53. #define    dtob(x)    ((x)<<9)
  54.  
  55. /* clicks to bytes */
  56. #define    ctob(x)    ((x)<<PGSHIFT)
  57.  
  58. /* bytes to clicks */
  59. #define    btoc(x)    ((((unsigned)(x)+(NBPG-1))>>PGSHIFT))
  60.  
  61. /*
  62.  * Macros to decode processor status word.
  63.  */
  64. #define    USERMODE(ps)    (((ps) & SR_SMODE) == 0)
  65. #define    BASEPRI(ps)    (((ps) & SR_INTPRI) == 0)
  66.  
  67.